package cn.enilu.flash.service.api.express.kdniao;

import cn.enilu.flash.utils.JsonUtil;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.util.List;

/**
 * @author ：enilu
 * @date ：Created in 2020/6/1 0:22
 */
@Data
public class KdniaoResponse {
    @JsonProperty("LogisticCode")
    private String logisticCode;
    @JsonProperty("ShipperCode")
    private String shipperCode;
    @JsonProperty("EBusinessID")
    private String eBusinessID;
    @JsonProperty("Success")
    private Boolean success;
    @JsonProperty("State")
    private String state;
    @JsonProperty("StateEx")
    private String stateEx;
    @JsonProperty("Location")
    private String location;
    @JsonProperty("DeliveryMan")
    private String deliveryMan;
    @JsonProperty("DeliveryManTel")
    private String deliveryManTel;
    @JsonProperty("Traces")
    private List<Trace> traces;

    public static void main(String[] args) {
        String json = "{\n" +
                "  \"EBusinessID\" : \"1784278\",\n" +
                "  \"ShipperCode\" : \"ZTO\",\n" +
                "  \"LogisticCode\" : \"78659392402681\",\n" +
                "  \"State\" : \"2\",\n" +
                "  \"StateEx\" : \"202\",\n" +
                "  \"Location\" : \"南通市\",\n" +
                "  \"Traces\" : [ {\n" +
                "    \"Action\" : \"1\",\n" +
                "    \"AcceptStation\" : \"【上海市】 【徐汇中部】（021-60665264） 的 尹承超18621356510（18621356510） 已揽收\",\n" +
                "    \"AcceptTime\" : \"2023-02-21 17:23:21\",\n" +
                "    \"Location\" : \"上海市\"\n" +
                "  }, {\n" +
                "    \"Action\" : \"2\",\n" +
                "    \"AcceptStation\" : \"【上海市】 快件离开 【徐汇中部】 已发往 【上海浦西转运中心】\",\n" +
                "    \"AcceptTime\" : \"2023-02-21 20:07:51\",\n" +
                "    \"Location\" : \"上海市\"\n" +
                "  }, {\n" +
                "    \"Action\" : \"2\",\n" +
                "    \"AcceptStation\" : \"【上海市】 快件已经到达 【上海浦西转运中心】\",\n" +
                "    \"AcceptTime\" : \"2023-02-21 21:39:02\",\n" +
                "    \"Location\" : \"上海市\"\n" +
                "  }, {\n" +
                "    \"Action\" : \"2\",\n" +
                "    \"AcceptStation\" : \"【上海市】 快件离开 【上海浦西转运中心】 已发往 【南通启东】\",\n" +
                "    \"AcceptTime\" : \"2023-02-21 21:39:18\",\n" +
                "    \"Location\" : \"上海市\"\n" +
                "  }, {\n" +
                "    \"Action\" : \"2\",\n" +
                "    \"AcceptStation\" : \"【南通市】 快件已经到达 【南通中转部】\",\n" +
                "    \"AcceptTime\" : \"2023-02-22 01:42:33\",\n" +
                "    \"Location\" : \"南通市\"\n" +
                "  }, {\n" +
                "    \"Action\" : \"2\",\n" +
                "    \"AcceptStation\" : \"【南通市】 快件离开 【南通中转部】 已发往 【南通启东】\",\n" +
                "    \"AcceptTime\" : \"2023-02-22 01:43:53\",\n" +
                "    \"Location\" : \"南通市\"\n" +
                "  }, {\n" +
                "    \"Action\" : \"2\",\n" +
                "    \"AcceptStation\" : \"【南通市】 快件已经到达 【南通启东】\",\n" +
                "    \"AcceptTime\" : \"2023-02-22 06:58:57\",\n" +
                "    \"Location\" : \"南通市\"\n" +
                "  }, {\n" +
                "    \"Action\" : \"202\",\n" +
                "    \"AcceptStation\" : \"【南通市】 【南通启东】 的吴健华（17156405111） 正在第1次派件, 请保持电话畅通," +
                "并耐心等待（95720为中通快递员外呼专属号码，请放心接听）\",\n" +
                "    \"AcceptTime\" : \"2023-02-22 09:05:05\",\n" +
                "    \"Location\" : \"南通市\"\n" +
                "  } ],\n" +
                "  \"DeliveryMan\" : \"吴健华\",\n" +
                "  \"DeliveryManTel\" : \"17156405111\",\n" +
                "  \"Success\" : true\n" +
                "}";
        KdniaoResponse response = JsonUtil.fromJson(KdniaoResponse.class,json);
        System.out.println(JsonUtil.toJson(response));
    }
}
